package com.honeywen.mymvc.test;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @author wangwei
 * @date 2019/5/9
 */
public class MyData {
    int num = 0;
    Lock lock = new ReentrantLock();
    public void add() {
        try {
            lock.lock();
            num++;

        } finally {
            lock.unlock();
        }
    }
}
